home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
sdoor100.zip
/
SDOOR.BI
< prev
next >
Wrap
Text File
|
1992-03-25
|
15KB
|
445 lines
' ---FUNCTIONS---
DECLARE FUNCTION AColor$ (Fore%, Back%)
' Makes an optimized ansi color string
' Fore% = Foreground color to use
' Back% = Background color to use
'
' EXAMPLE:
' Send AColor$(7,1)+"White on blue"
DECLARE FUNCTION CtrlCK% ()
' Checks if Control C/K have been checked. Also enables Control C/K
' checking. Returns -1 if true, 0 if not true.
'
' EXAMPLE:
' IF CtrlCK% THEN
' FlushOut
' SendCr "Aborted."
' END IF
DECLARE FUNCTION Exist% (FileName$)
' Returns a non-zero value if the file exists.
'
' EXAMPLE:
' IF Exist%("TEST.TTT") THEN Send "File FOUND"
DECLARE FUNCTION GetAnsi% ()
' Gets the current ansi setting. Returns -1 if true, 0 if not true.
'
' EXAMPLE:
' AnsiMode%=GetAnsi%
' IF AnsiMode% THEN
' SendCr "Ansi is active"
' ELSE
' SendCr "Ansi is not active"
' END IF
DECLARE FUNCTION GetBaudRate& ()
' Gets the current baud rate of the user (Door Info). 0 if local.
'
' EXAMPLE:
' Send "You are running at" + STR$(GetBaudRate&)
DECLARE FUNCTION GetBBSName$ ()
' Gets the BBS name from the door file.
'
' EXAMPLE:
' SendCr "Your sysop is: " + GetSysopName$
DECLARE FUNCTION GetCarrier% ()
' Gets the current carrier state. Non-zero if there is a carrier.
' The user's carrier is automatically managed. This is not really
' needed.
'
' EXAMPLE:
' IF GetCarrier% THEN Send "YOU ARE STILL CONNECTED"
DECLARE FUNCTION GetPort% ()
' Gets the current serial port setting. -1 if local
'
' EXAMPLE:
' Send "You are on com port" + STR$(GetPort%)
DECLARE FUNCTION GetSecLevel& ()
' Gets the user's security level.
'
' EXAMPLE:
' Send "Your security Level is" + STR$(GetSecLevel&)
DECLARE FUNCTION GetSnoopState% ()
' Gets the status of the snoop setting on the SysOp's side.
' Returns -1 if true, 0 if not.
'
' EXAMPLE:
' IF GetSnoopState% THEN
' Send "Snoop is ON"
' ELSE
' Send "Snoop is OFF"
' ENDIF
DECLARE FUNCTION GetSysopName$ ()
' Gets the sysop's name, in all uppercase.
'
' EXAMPLE:
' Send "Your sysop is: " + GetSysopname$
DECLARE FUNCTION GetTimeLeft% ()
' Gets the amount of time the user has left in minutes.
'
' EXAMPLE:
' Send "You have" + STR$(GetTimeLeft%)+" minutes left."
DECLARE FUNCTION GetUserLocation$ ()
' Gets the user's location (DOOR INFO) in all uppercase
'
' EXAMPLE:
' Send "Your location is: " + GetUserLocation$
DECLARE FUNCTION GetUserName$ ()
' Gets the user's name (DOOR INFO) in all uppercase
'
' EXAMPLE:
' Send "Your name is: " + GetUserName$
' ---END OF FUNCTIONS---
' ---SUBROUTINES---
DECLARE SUB Center (St$)
' Centers the specified text and stays on the same line.
'
' EXAMPLE:
' Center "Testing the centering routine"
DECLARE SUB CenterCr (St$)
' Centers the specified text and creates a new line.
'
' EXAMPLE:
' CenterCr "Testing the centering routine"
DECLARE SUB Chat ()
' Starts a chatmode with the user. Restores the colors to normal
' afterwards.
'
' EXAMPLE:
' SendCr "Forced CHAT:"
' Chat
DECLARE SUB ClearScreen ()
' Clears the screen
'
' EXAMPLE:
' ClearScreen
DECLARE SUB ComParms (BaudRate&, Flag$)
' Sets the communications parameters. These are already set upon
' initialization. There should be no need to play with them.
'
' BaudRate& can be: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400
' Flag$ takes the form of: "8N1" where the 8 can be replaced by:
' 5, 6, 7, 8 (Data bits)
' and the N can be replaced by:
' N, O, E (Parity)
' and the 1 can be replaced by:
' 1, 2 (Stop bits)
'
' EXAMPLE:
' ComParms 2400, "8N1"
DECLARE SUB CtrlCKOn ()
' Turns on Control-C/K checking.
'
' EXAMPLE:
' CtrlCKOn
DECLARE SUB CtrlCKOff ()
' Turns off Control-C/K checking.
'
' EXAMPLE:
' CtrlCKOff
DECLARE SUB DeInitialize ()
' Turns off the status bar and removes it from the screen. Disables
' the door driver and turns off the door driver's internal error
' checking. Also causes Send, SendCr, and all other routines to
' malfunction. DO NOT DO ANY OTHER DOORDRIVER CALLS AFTER
' DEINITIALIZING! DOES NOT TERMINATE THE PROGRAM.
'
' EXAMPLE:
' DeInitialize
' Print "Cleaning up after door"
' END
DECLARE SUB DetectAnsi (Ansi%)
' Detects Ansi (Remote user)
' Returns -1 or 0 into Ansi% (or any other variable of your choice)
'
' EXAMPLE:
' DetectAnsi Ansi%
' SetAnsi Ansi%
DECLARE SUB FlushIn ()
' Flushes the inbound modem buffer. Wipes all user keystrokes.
'
' EXAMPLE:
' FlushIn
' Send "What now sire? "
' GetChar ToDoThis$
' SendCr ToDoThis$
DECLARE SUB FlushOut ()
' Flushes the outbound modem buffer. Usefull for stopping screens
' when Control-C/K have been pressed.
'
' EXAMPLE:
' SendCr "Press Control-C/K to stop this mess"
' CtrlCKOn
' DO
' SendCr "Testing 1234567890..."
' I$ = Inkey$
' LOOP UNTIL I$ = CHR$(3) OR I$ = CHR$(11) OR CtrlCK%
' SendCr "Aborted."
DECLARE SUB GetChar (Ch$)
' Gets a character from the modem into Ch$. (Ch$ can be any
' variable)
'
' EXAMPLE:
' SendCr "Yo there dude! Press any key please!"
' GetChar Test$
' SendCr "Thanks!"
DECLARE SUB GetColor (Fore%, Back%)
' Gets the current foreground and background colors.
'
' EXAMPLE:
' GetColor ForeGround%, BackGround%
' SendCr "The foreground color is: " + STR$(ForeGround%)
' SendCr "The background color is: " + STR$(BackGround%)
DECLARE SUB GetCurPos (X%, Y%)
' Gets the cursor position.
' X% = The Current Row
' Y% = The Current Column
'
' EXAMPLE:
' GetCurPos X%, Y%
' SendCr "The row is: " + STR$(X%)
' SendCr "The column is: " + STR$(Y%)
DECLARE SUB GetString (St$, Max%, Mode%)
' Gets a string from the modem/console.
' St$ = The returned string.
' Max% = The max width/value.
' Mode% = Input mode:
' 0 :- Normal Input, exactly as entered.
' Max% = Maximum length in characters.
' 1 :- UserName Input, Every first character of a word is
' converted to uppercase. Uppercase characters after
' the first letter of each word are accepted.
' Max% = Maximum length in characters.
' 2 :- Numeric input. Allows from 0 to the number specified.
' Allows blank strings for 0. Returned value is a
' string.
' Max% = Maximum value (Integer value; 0 - 32767)
' 3 :- Password input. Outputs dots (.) instead of entered
' characters. Case